<?php

/**
 * RisqueContrainte form base class.
 *
 * @method RisqueContrainte getObject() Returns the current form's model object
 *
 * @package    kc_report_proto
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseRisqueContrainteForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'rco_id'                         => new sfWidgetFormInputHidden(),
      'prj_id'                         => new sfWidgetFormInputText(),
      'rco_libelle'                    => new sfWidgetFormInputText(),
      'rco_nature'                     => new sfWidgetFormInputText(),
      'rco_avant_probabilite'          => new sfWidgetFormInputText(),
      'rco_avant_gravite'              => new sfWidgetFormInputText(),
      'rco_avant_criticite_precedente' => new sfWidgetFormInputText(),
      'rco_apres_probabilite'          => new sfWidgetFormInputText(),
      'rco_apres_gravite'              => new sfWidgetFormInputText(),
      'rco_zone_impact'                => new sfWidgetFormInputText(),
      'rco_date_emission'              => new sfWidgetFormDateTime(),
      'rco_date_fermeture'             => new sfWidgetFormDateTime(),
      'rco_etat'                       => new sfWidgetFormInputText(),
      'rco_commentaire'                => new sfWidgetFormInputText(),
      'rco_type'                       => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'rco_id'                         => new sfValidatorChoice(array('choices' => array($this->getObject()->get('rco_id')), 'empty_value' => $this->getObject()->get('rco_id'), 'required' => false)),
      'prj_id'                         => new sfValidatorInteger(),
      'rco_libelle'                    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'rco_nature'                     => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'rco_avant_probabilite'          => new sfValidatorInteger(array('required' => false)),
      'rco_avant_gravite'              => new sfValidatorInteger(array('required' => false)),
      'rco_avant_criticite_precedente' => new sfValidatorInteger(array('required' => false)),
      'rco_apres_probabilite'          => new sfValidatorInteger(array('required' => false)),
      'rco_apres_gravite'              => new sfValidatorInteger(array('required' => false)),
      'rco_zone_impact'                => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'rco_date_emission'              => new sfValidatorDateTime(array('required' => false)),
      'rco_date_fermeture'             => new sfValidatorDateTime(array('required' => false)),
      'rco_etat'                       => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'rco_commentaire'                => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'rco_type'                       => new sfValidatorString(array('max_length' => 20, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('risque_contrainte[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'RisqueContrainte';
  }

}
